#pragma once

#include <QtWidgets/QMainWindow>
#include "../common/CommonListView.h"
#include "../common/CommonListView.h"
#include <QSize>
#include <QIcon>
#include "ffmpeg/sample/FFMpegSamplePlayerWindow.h"
#include "ffmpeg/FFMpegDemuxerWindow.h"
#include "ffmpeg/XVideoWindow.h"
#include "ffmpeg/xplayer/XVideoPlayerWindow.h"
#include "ffmpeg/xplayer/XPlay2.h"
#include "ffmpeg/FFMpegRecordInterfaceWindow.h"
#include "ffmpeg/rtmp_pusher/RtmpPusherWindow.h"
#include "ffmpeg/rtmp_pusher/OpenCVRtspToRtmpWindow.h"
#include "ffmpeg/rtmp_pusher_audio/UseQtRecordAudioWindow.h"
#include "ffmpeg/rtmp_pusher_audio/RtmpPushAudioUseFFmpegWindow.h"
#include "ffmpeg/record_screen/rgb_to_mp4_window.h"
#include "ffmpeg/record_screen/MediaFormatFactoryWindow.h"
#include "ffmpeg/record_screen/Pcm2AacWindow.h"
#include "ffmpeg/record_screen/RGBPcm2Mp4Window.h"
#include "ffmpeg/record_screen/TonyCaptureScreenTestWindow.h"
#include "ffmpeg/record_screen/AudioRecordWindow.h"
#include "ffmpeg/record_screen/video_recoder/xscreen.h"
#include "ffmpeg/sample/PixelFormatConversionToolWindow.h"
#include "ffmpeg/sample/GenerateH26XWindow.h"
#include "ffmpeg/sample/H264OrH265FilePlayWindow.h"
#include "ffmpeg/sample/H264OrH265FilePlayByEncapsulationWindow.h"
#include "ffmpeg/sample/DeMuxerAndPlayWindow.h"
#include "ffmpeg/sample/RePackingMp4Window.h"
#include "ffmpeg/sample/RePackingMp4ByFormatCodeWindow.h"
#include "ffmpeg/sample/TranscodingWindow.h"
#include "ffmpeg/sample/TestWindow.h"
#include "ffmpeg/sample/PlayAndRecordRTSPStreamWindow.h"
#include "ffmpeg/yviewer/MultiChannelMonitoringWindow.h"

#include <QMetaType>

class FFMpegWindow : public QMainWindow
{
	Q_OBJECT

public:
	FFMpegWindow(QWidget *parent = nullptr);
	~FFMpegWindow();

public:
	void createListView();//创建一个ListView

private:
	CommonListView* listView;
	/*FFMpegSamplePlayerWindow fFMpegSamplePlayerWindow;
	FFMpegDemuxerWindow fFMpegDemuxerWindow;
	XVideoWindow xVideoWindow;
	XVideoPlayerWindow xVideoPlayerWindow;*/
	//xplayer
	XPlay2 xPlay2;
	//封装
	FFMpegRecordInterfaceWindow fFMpegRecordInterfaceWindow;
	//rtmp推流
	RtmpPusherWindow rtmpPusherWindow;
	//利用opencv将rtsp转rtmp推流
	OpenCVRtspToRtmpWindow openCVRtspToRtmpWindow;
	//利用qt录制rtmp音频小案例
	UseQtRecordAudioWindow useQtRecordAudioWindow;
	//利用qt录制音频，使用ffmpeg将音频推送至rtmp服务器
	RtmpPushAudioUseFFmpegWindow rtmpPushAudioUseFFmpegWindow;
	//rgb转mp4
	rgb_to_mp4_window rgbToMp4Window;
	//格式工厂
	MediaFormatFactoryWindow mediaFormatFactoryWindow;
	//pcm转aac
	Pcm2AacWindow pcm2AacWindow;
	//rgb pcm转mp4
	RGBPcm2Mp4Window rGBPcm2Mp4Window;
	//屏幕抓取测试
	TonyCaptureScreenTestWindow *tonyCaptureScreenTestWindow;
	//qt音频录制
	AudioRecordWindow  audioRecordWindow;
	//录屏
	XScreen xScreenWindow;
	//像素格式转换工具
	PixelFormatConversionToolWindow *pixelFormatConversionToolWindow;
	//将录屏数据转成H26x(H264/H265)
	GenerateH26XWindow *generateH26XWindow;
	//播放H264或H265文件（封装）
	H264OrH265FilePlayWindow* h264OrH265FilePlayWindow;
	//播放H264或H265文件，通过封装后的类进行播放
	H264OrH265FilePlayByEncapsulationWindow *h264OrH265FilePlayByEncapsulationWindow;
	//解封装后解码渲染
	DeMuxerAndPlayWindow *deMuxerAndPlayWindow = nullptr;
	//重新封装Mp4（如果是网络流可用于录制）
	RePackingMp4Window* rePackingMp4Window;
	//重新封装Mp4（如果是网络流可用于录制->升级，通过封装后的代码完成，让代码看起来更简洁，使用起来更方便
	RePackingMp4ByFormatCodeWindow* rePackingMp4ByFormatCodeWindow;
	//视频转码
	TranscodingWindow* transcodingWindow;
	//测试OpenGL+FFMPEG渲染YUV420P的数据
	TestWindow* testWindow;
	//播放并录制RTSP流（远程摄像机流）
	PlayAndRecordRTSPStreamWindow* playAndRecordRTSPStreamWindow;
	//H264、H265音视频多路录放
	MultiChannelMonitoringWindow* multiChannelMonitoringWindow;
};
